<div class="user-index">
	<h2>Groups Manager</h2>

	<table class="table hovered">
		<thead>
		<tr>
			<th class="text-left">Id</th>
			<th class="text-left">Name</th>
			<th class="text-left">Create at</th>
		</tr>
		</thead>
		<tbody>
	<?php
	foreach ($groups as $group) {
		echo '<tr>';
			echo '<td>'.$group['Group']['id'].'</td>';
			echo '<td>'.$this->Html->link($group['Group']['name'], array('controller'=>'users', 'action'=>'view', $group['Group']['id'])).'</td>';
			echo '<td>'.$group['Group']['created'].'</td>';
		echo '</tr>';
	}
	unset($group);
	?>
	</tbody></table>

	<?php echo '<p style="text-align: right;">'.$this->Html->link(
	    'Add Group',
	    array('controller' => 'groups', 'action' => 'add')).'</p>'; ?>

	<?php
	echo '<div class="paginate">';
	echo $this->Paginator->first('Frst page');//di den trang dau tien
	echo '&nbsp&nbsp&nbsp'.$this->Paginator->prev('« Previous ', null, null, array('class' => 'disabled')); //Shows the next and previous links
	echo " | ".$this->Paginator->numbers()." | "; //Shows the page numbers
	echo $this->Paginator->next(' Next »', null, null, array('class' => 'disabled')); //Shows the next and previous links
	echo " Page ".$this->Paginator->counter().'&nbsp'; // prints X of Y, where X is current page and Y is number of pages
	echo $this->Paginator->last('... Last page');//di den trang cuoi cung
	echo '</div>';
	?>
</div>